//package com.batch.quartz.config;
//
//import com.batch.quartz.job.ImportUserQuartzJob;
//import org.springframework.batch.core.configuration.JobLocator;
//import org.springframework.batch.core.configuration.JobRegistry;
//import org.springframework.batch.core.configuration.support.JobRegistryBeanPostProcessor;
//import org.springframework.batch.core.launch.JobLauncher;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//import org.springframework.scheduling.quartz.JobDetailFactoryBean;
//
//import java.util.HashMap;
//import java.util.Map;
//
///**
// * <h3>partitionjob</h3>
// * <p>quartz </p>
// *
// * @author : hduong
// * @version : 1.0
// * @date : 2019-12-20 17:38
// **/
//@Configuration
//public class QuartzConfiguration {
//
//    //自动注入进来的是SimpleJobLauncher
//    @Autowired
//    private JobLauncher jobLauncher;
//
//    @Autowired
//    private JobLocator jobLocator;
//
//    /*用来注册job*/
//    /*JobRegistry会自动注入进来*/
//    @Bean
//    public JobRegistryBeanPostProcessor jobRegistryBeanPostProcessor(JobRegistry jobRegistry){
//        JobRegistryBeanPostProcessor jobRegistryBeanPostProcessor = new JobRegistryBeanPostProcessor();
//        jobRegistryBeanPostProcessor.setJobRegistry(jobRegistry);
//        return jobRegistryBeanPostProcessor;
//    }
//
//    @Bean
//    public JobDetailFactoryBean jobDetailFactoryBean(){
//        JobDetailFactoryBean jobFactory = new JobDetailFactoryBean();
//        jobFactory.setJobClass(ImportUserQuartzJob.class);
//        jobFactory.setGroup("my_group");
//        jobFactory.setName("my_job");
//
//        Map<String, Object> map = new HashMap<>();
//        map.put("jobName", "lzjJob");
//        map.put("jobLauncher", jobLauncher);
//        map.put("jobLocator", jobLocator);
//        jobFactory.setJobDataAsMap(map);
//
//        return jobFactory;
//    }
//}
